# 导包
import jsonschema
# 定义jsonschema格式的校验规则
jsonschema_rules={
    "type":"object",
    "properties":{
        "success":{"type":"boolean"},
        "code":{"type":"integer"},
        "message":{"type":"string"}
    },
    "required":["success","message","code"]
}
# 3、调用jsonchema.validate(instance="json数据",schema="jsonschema规则")方法进行校验
checked_data={"success":True,
              "code":10000,
              "message":"操作成功"}
result=jsonschema.validate(instance=checked_data,schema=jsonschema_rules)
print(result)